﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Celeriq.Common;

namespace Celeriq.ManagementStudio
{
	public partial class UserListForm : Form
	{
		private string _serverName;
		private UserCredentials _credentials;
		private string _publicKey;

		public UserListForm()
		{
			InitializeComponent();
		}

		public UserListForm(string serverName, UserCredentials credentials, string publicKey)
			: this()
		{
			_serverName = serverName;
			_credentials = credentials;
			_publicKey = publicKey;
		}

		private void cmdAdd_Click(object sender, EventArgs e)
		{
			var F = new UserEditForm(_serverName, _credentials, _publicKey);
			if (F.ShowDialog() == System.Windows.Forms.DialogResult.OK)
			{
				
			}
		}

		private void cmdEdit_Click(object sender, EventArgs e)
		{
			var F = new UserEditForm(_serverName, _credentials, _publicKey);
			if (F.ShowDialog() == System.Windows.Forms.DialogResult.OK)
			{

			}
		}

		private void cmdDelete_Click(object sender, EventArgs e)
		{
			if (MessageBox.Show("Do you wish to delete the selected user?", "Delete User", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != System.Windows.Forms.DialogResult.Yes)
				return;


		}

		private void cmdClose_Click(object sender, EventArgs e)
		{
			this.Close();
		}
	}
}
